package com.mark.web.stars.enums;

import com.mark.web.stars.entity.po.Fragment;

/**
 * @Description: 碎片状态的枚举类
 * @Author: Mark
 * @CreateDate: 2019/4/18 21:45
 * @Version: 2.0
 * @Copyright : 豆浆油条个人非正式工作室
 */
public enum FragmentEnum {

    SECRECY(1, "保密"),
    OPEN(1, "公开");

    /**
     * 状态
     */
    private int state;

    /**
     * 描述
     */
    private String desc;

    FragmentEnum(int state, String desc) {
        this.state = state;
        this.desc = desc;
    }

    public static String stateOf(int state){
        for(FragmentEnum fragmentEnum : values()){
            if(fragmentEnum.getState() == state){
                return fragmentEnum.getDesc();
            }
        }
        return "未知";
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}